package com.xingshentech.ugv.operate.module.bean2;

//这段代码定义了一个 DeviceStatusEnum 枚举类，主要用于表示 设备状态。它包含了不同状态的枚举值，并提供了方法来匹配状态值。
public enum DeviceStatusEnum {
    //    设备状态：1-开机启动中；2-开机状态；3-关机中;4-关机状态;5-关机准备充电;6-关机充电状态;7-开机准备充电;8-开机充电状态;9-休眠开始中;10-休眠状态;11/12-开始启动休眠充电;13-休眠充电状态
    def(0, "未知"),
    startUp(1, "开机启动中"),
    powerOnStatus(2, "开机状态"),
    shutdowning(3, "关机中"),
    shutdownStatus(4, "关机状态"),
    shutdownPrepareCharge(5, "关机准备充电"),
    shutdownChargeStatus(6, "关机充电状态"),
    startPrepareCharge(7, "开机准备充电"),
    powerOnChargeStatus(8, "开机充电状态"),
    sleepStart(9, "休眠开始中"),
    sleep(10, "休眠状态"),
    startSleepCharge1(11, "开始启动休眠充电"),
    startSleepCharge2(12, "开始启动休眠充电"),
    sleepChargeState(13, "休眠充电状态"),
    ;


    public static DeviceStatusEnum match(int status) {
        DeviceStatusEnum deviceStatus = null;
        for (DeviceStatusEnum deviceStatusEnum : values()) {
            if (deviceStatusEnum.getStatus() == status) {
                deviceStatus = deviceStatusEnum;
                break;
            }
        }
        return deviceStatus;
    }

    DeviceStatusEnum(int status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    int status;
    String msg;

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}
